package com.carassistant.beta.common;

import java.util.ArrayList;

import android.content.Context;
import android.content.res.XmlResourceParser;
import android.view.View;
import antlr.StringUtils;

/**
 *@fPaserLayoutHelper.java 布局解析类
 * @author thinkpad
 * @time2014-1-23
 *
 */
public class PaserLayoutHelper {
	
	Context context;
	private ArrayList<String> list=new ArrayList<String>();
	
	public PaserLayoutHelper(Context context){
		this.context=context;
	}
	
	/**
	 * 解析布局文件
	 * @param layoutResID
	 */
	/*public ArrayList<String> parseLayoutById(int layoutResID) {
		XmlResourceParser xmlResourceParser = context.getResources().getLayout(layoutResID);
		try {
			int eventType = xmlResourceParser.getEventType();
			while (eventType != XmlResourceParser.END_DOCUMENT) {
				switch (eventType) {
				case XmlResourceParser.START_TAG:
					int id = xmlResourceParser
						.getAttributeResourceValue(Consts.NAME_SPACE, "id", -1);
					//绑定字段
					String field = "";
					if (id != -1) {
						field = getViewField(id);
						if(field.equals("")){
							list.add(field);
						}
					}
					break;
				}
				eventType = xmlResourceParser.next();
			}
			return list;
		} catch (Exception e) {
		}
		return null;
	}
	*/
	
/*	public String getViewField(int viewId){
		View view =  context.findViewById(viewId);
		String field = null;
		if (view instanceof MyjamesTextView) {
			field = ((MyjamesTextView) view).getField();
		}
		return field;
	}
	*/

}
